<%--
  Created by IntelliJ IDEA.
  User: ${USER}
  Date: ${DATE}
  Time: ${TIME}
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isErrorPage="false" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<base href="<%= basePath %>"/>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

    <title>积分明细</title>

    <link href="static/business/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="static/business/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">
    <link href="static/business/css/personal.css" rel="stylesheet" type="text/css">
    <link href="static/business/css/point.css" rel="stylesheet" type="text/css">
    <script src="static/business/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="static/business/AmazeUI-2.4.2/assets/js/amazeui.js"></script>
</head>

<body>
<!--头 -->
<jsp:include page="header.jsp"/>
<div class="nav-table"></div>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">
            <div class="points">
                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">我的积分</strong> / <small>My&nbsp;Point</small>
                    </div>
                </div>
                <hr/>
                <div class="pointsTitle">
                    <div class="usable">可用积分<span>

<c:set var="x" value="0"/>
<c:forEach items="${points}" var="p">
    <c:set var="x" value="${x + p.chargePoint}"/>
</c:forEach>
							${x}
						</span></div>
                    <div class="pointshop"><a href="#"><i><img src="<%= basePath %>static/business/images/u5.png"/></i>积分商城</a>
                    </div>
                    <div class="signIn"><a href="javascript:void(0)" onclick="SignIn('${signIn}')"><i
                            class="am-icon-calendar"></i><em>+5</em>每日签到</a>
                    </div>
                </div>
                <div class="pointlist am-tabs" data-am-tabs>
                    <ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs">
                        <li class="am-active"><a href="#tab1">全部</a></li>
                        <li><a href="#tab2">获得</a></li>
                        <li><a href="#tab3">支出</a></li>
                    </ul>

                    <div class="am-tabs-bd">
                        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                            <table>
                                <b></b>
                                <thead>
                                <tr>
                                    <th class="th1">积分详情</th>
                                    <th class="th2">积分变动</th>
                                    <th class="th3">日期</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="p" items="${points}">
                                    <tr>
                                        <td class="pointType">
                                            <c:if test="${p.source == 0}">
                                                订单
                                            </c:if>
                                            <c:if test="${p.source  == 1}">
                                                登录
                                            </c:if>
                                            <c:if test="${p.source == 2}">
                                                活动
                                            </c:if>
                                        </td>
                                        <td class="pointNum">${p.chargePoint}</td>
                                        <td class="pointTime">${p.createTime}</td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                        <div class="am-tab-panel am-fade" id="tab2">
                            <table>
                                <b></b>
                                <thead>
                                <tr>
                                    <th class="th1">积分详情</th>
                                    <th class="th2">获取积分</th>
                                    <th class="th3">日期</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="p" items="${points}">
                                    <c:if test="${p.chargePoint>0}">
                                        <tr>

                                            <td class="pointType">
                                                <c:if test="${p.source == 0}">
                                                    订单
                                                </c:if>
                                                <c:if test="${p.source  == 1}">
                                                    登录
                                                </c:if>
                                                <c:if test="${p.source == 2}">
                                                    活动
                                                </c:if>
                                            </td>
                                            <td class="pointNum">${p.chargePoint}</td>
                                            <td class="pointTime">${p.createTime}</td>
                                        </tr>
                                    </c:if>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                        <div class="am-tab-panel am-fade" id="tab3">
                            <table>
                                <b></b>
                                <thead>
                                <tr>
                                    <th class="th1">积分详情</th>
                                    <th class="th2">消耗积分</th>
                                    <th class="th3">日期</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="p" items="${points}">
                                    <c:if test="${p.chargePoint>0}">
                                        <tr>
                                            <td class="pointType">
                                                <c:if test="${p.source == 0}">
                                                    订单
                                                </c:if>
                                                <c:if test="${p.source  == 1}">
                                                    登录
                                                </c:if>
                                                <c:if test="${p.source == 2}">
                                                    活动
                                                </c:if>
                                            </td>
                                            <td class="pointNum">${p.chargePoint}</td>
                                            <td class="pointTime">${p.createTime}</td>
                                        </tr>
                                    </c:if>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>

                    </div>

                </div>
            </div>
        </div>
        <!--底部-->
        <div class="footer"></div>
    </div>
    <aside class="menu"></aside>
</div>
</body>
<script>
    $(function () {
        $(".nav-table").load("<%= basePath %>static/business/person/nav.jsp");
        $("div.footer").load("<%= basePath %>static/business/home/footer.jsp");
        $("aside").load("<%= basePath %>static/business/home/aside.jsp");
    })

    function SignIn(signIn) {
        if (signIn == 0) {
            window.alert("已签到")
            window.location.href = "cntApi/addPoint?userPoint=5";
        } else {
            window.alert("已签到")
        }


    }


</script>
</html>